import React, { Component } from 'react'
import {connect} from 'react-redux'
import { increaement, decreaement , increaemenAsync} from '../redux/Action/action'
 class Num extends Component {
   increaement=()=>{
    this.props.increaement(1)
   }

   decreaement=()=>{
     this.props.decreaement(1)
     console.log(this.props)
   }
  render() {
    const {count} =this.props
    return (
      <div>
        <div style={{margin:'20px 0'}}>
          <button style={{fontSize:"20px"}}  onClick={this.increaement}>十</button>
          <div style={{margin:'0 10px',fontSize:"20px",display:'inline-block'}}>{count}</div>
          <button style={{fontSize:"20px"}}  onClick={this.decreaement}>一</button>
        </div>
      </div>
    )
  }
}

export default connect(
  state=>({
    count:state.count
  }),
  {increaement, decreaement , increaemenAsync}
)(Num)

